package jay.home.bet.web.struts;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jay.home.bet.domain.League;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class UpdateLeaguesAction extends BaseAction
{

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception
	{

		String name_zh = request.getParameter("name_zh");
		String name_tw = request.getParameter("name_tw");
		String name_en = request.getParameter("name_en");
		League league = getBasicService().getLeague("1");
		league.setName_zh(name_zh);
		league.setName_tw(name_tw);
		league.setName_en(name_en);
		getBasicService().updateLeague(league);
		request.setAttribute("League", league);
		return mapping.findForward("SUCCESS");
	}
}
